Skip to content

Conversation

@christinakopi
Copy link
Collaborator

@christinakopi christinakopi commented Jun 26, 2025

Roadmap:

  • ensure bijection between onnx and tfjs weights
  • add progress indicator to hellaswag benchmark
  • move filesystem logic to discojs-node and cli
  • automate downloading onnx model from hub
  • convert python script to nodejs and web-compatible logic
  • experiment with webgpu for hellaswag
  • experiment with converting tfjs back to onnx

The table below shows the accuracy along with the time of the evaluation on the whole HellaSwag for each model tested:

Model Accuracy Eval Time (s)
TFJS GPT (gpt-nano) 24.67% 1390.25
Xenova GPT-2 (ONNX) 29.03% 22767.03
Loaded TFJS GPT (from ONNX) 28.41% 12523.59

Copy link
Member

@martinjaggi martinjaggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing work, thanks a lot!
later i'd be very curious to check if also the conversion in the reverse direction (to onnx) works fine.

@JulienVig JulienVig force-pushed the NAN-init_from_ONNX-christinakopi branch from ae33116 to 99e2db4 Compare November 26, 2025 01:27
@JulienVig JulienVig changed the title First try of loading the weights of the pretrained ONNX GPT2 model into our GPT2-tfjs implementation ONNX to Tensorflow.js conversion of GPT-2 Nov 26, 2025
@JulienVig JulienVig force-pushed the NAN-init_from_ONNX-christinakopi branch 5 times, most recently from 772832d to 464ff8b Compare November 26, 2025 04:43
@JulienVig JulienVig marked this pull request as ready for review November 26, 2025 05:01
@JulienVig JulienVig requested a review from tharvik November 26, 2025 05:01
Copy link
Collaborator

@tharvik tharvik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haa, that's great work, well done in hacking around the onnx protobuf!
nothing blocking (except the tsc --build thing), only a few nitpicks and questions here and there

@JulienVig JulienVig force-pushed the NAN-init_from_ONNX-christinakopi branch from 464ff8b to 7052329 Compare January 19, 2026 15:46
@JulienVig JulienVig force-pushed the NAN-init_from_ONNX-christinakopi branch from 7052329 to 9fbe6b3 Compare January 19, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants